package 循环语句作业;

public class homework4 {

    public static void main(String[] args) {
    System.out.println("100到999之间的水仙花数有: ");
    for (int i = 100; i < 1000; i++) {
        int hundreds = i / 100;
        int tens = (i % 100) / 10;
        int units = i % 10;
        if (i == (hundreds * hundreds * hundreds + tens * tens * tens + units * units * units)) {
            System.out.print(i + " ");
        }
    }
    System.out.println();
}
}

